package com.wzdigit.wms.basic.client.request.basic;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 创建车辆输入
 * @author yangdongjie
 * @WarehouseAttrResponse.java
 * @2020年12月31日下午5:18:20
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"}, ignoreUnknown = false)
public class CreateVehicleRequest implements Serializable {
	
	private static final long serialVersionUID = -8754107305575336961L;

	/**
	 * 车牌号
	 */
	@ApiModelProperty(value = "车牌号", required = true)
	@NotBlank(message = "车牌号不能为空")
    private String vehicleNo;

	/**
	 * 车型
	 */
	@ApiModelProperty(value = "车型", required = true)
	@NotNull(message = "车型不能为空")
    private Integer vehicleType;

	/**
	 * 司机
	 */
	@ApiModelProperty(value = "司机", required = false)
    private String driver;

	/**
	 * 司机电话
	 */
	@ApiModelProperty(value = "司机电话", required = false)
	@Pattern(regexp = "1[3,4,5,8]{1}\\d{9}", message = "手机号码格式有误")
    private String phone;

	/**
	 * 运输公司（承运人）
	 */
	@ApiModelProperty(value = "运输公司（承运人）", required = false)
    private Integer carrierId;

	/**
	 * 用户自定义字段1
	 */
	@ApiModelProperty(value = "用户自定义字段1（车型名称）", required = true)
	@NotBlank(message = "车型名称不能为空")
    private String udf1;

	/**
	 * 状态
	 */
	@ApiModelProperty(value = "状态", required = true)
	@NotNull(message = "状态不能为空")
	@Range(min = 0, max = 1, message = "状态错误")
    private Integer status;

	/**
	 * 备注
	 */
	@ApiModelProperty(value = "备注", required = false)
    private String comments;
}